home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 014 / cmp.arc / CMP.DOC < prev   
Encoding:
Text File  |  1986-01-19  |  8.0 KB  |  193 lines

  1.  
  2.  
  3. DOCUMENTATION FOR CMP.COM  version 1.0  Sept. 11, 1983
  4. BY Jack Gersbach
  5.  
  6. CMP.COM is a file comparison utility program that has the power
  7. to perceive added and deleted sections of a file as well as changes.
  8.  
  9. The files to be compared may be specified on the same line with the
  10. calling command.  If they are not included, you will be prompted for
  11. the file specifications. This gives you a chance to change disks before
  12. the compare operation begins. If the file specifications are included
  13. on the command line, it is assumed that the disk that contains CMP.COM
  14. is conveniently mounted and you will not get the question "Compare
  15. more files ?" before exiting to DOS.
  16. The first specification must have a file name.
  17. If a drive is not specified, the default drive is assumed. If the second
  18. specification does not contain a file name, it is assummed to be the
  19. same name as the first. If there is no second specification, the default
  20. drive is assumed. If the file specifications are the same or if the
  21. second defaults to the first, then the file will be compared to itself
  22. and a warning message is issued. This is a handy way to check for disk
  23. errors.
  24.  
  25. The output is displayed in chronological order.
  26. Data unique to the most recent version of the file is listed first and
  27. labeled "Ins". Following that, data unique to the older version is
  28. displayed and labeled "Del". There may be only 1 file with unique data.
  29. If neither files have unique data, then they are identical.
  30.  
  31. The display shows the offset within the file of the leftmost byte
  32. in hexidecimal notation. This is always aligned to a paragraph
  33. boundary making the low nibble zero. All data shown in the hex area
  34. is unique. A double period is displayed if the byte is not unique to
  35. the file. The dash separates bytes 7 and 8.
  36.  
  37. The ASCII representation appears on the right. A dash is displayed if
  38. the byte is not unique. A period is displayed for non ASCII characters.
  39.  
  40.                Data unique to  A:FILE1.COM
  41.  
  42. Ins:00030  .. .. .. 4E 65 77 .. ..-.. .. .. .. .. .. .. .. [---New----------
  43. Ins:00140  .. .. .. .. 69 .. .. ..-.. BA .. .. 43 .. .. .. [----i----.--C---]
  44.  
  45.                Data unique to  B:FILE1.COM
  46.  
  47. Del:00140  .. 61 .. .. .. .. 58 ..-.. 00 .. .. .. .. .. .. [-a----X--.------]
  48.  
  49. In the above example the format is independent of the order in
  50. which the file names were entered. The file on drive "A" is listed
  51. first bwce to the earlier file on drive "B"
  52. was evidently "Deleted" and is labeled accordingly. The changes would
  53. be perceived by the person who made them to be the added word "New"
  54. and later in the file, 3 bytes whose value have been change but occupy
  55. the same positions relative to the data surrounding them.
  56.  
  57. Compare does a reasonably good job of deducing differences between
  58. files that have just a few changes. Some difficulty arises when there
  59. is a high difference density. This is especially true when a few
  60. changed bytes are intermixed with added or deleted data.  In these cases
  61. it may be difficult to interpret CMP.COM's output, but at a minimum it
  62. will let you know that there is a difference of some kind.
  63.  
  64. The algorithm implemented in CMP.COM involves 2 basic parameters.
  65. a. The maximum scan range or number of bytes to be scanned and
  66. b. The minimum match length that is considered to be a valid compare.
  67. The default values are 256 and 16, respectively.
  68.  
  69. The procedure is as follows :
  70.  
  71.         1. Scan ahead for matching bytes on the assumption that no
  72.            data has been inserted or deleted until matching bytes are
  73.            encountered. Save the distance to the matching bytes. The
  74.            maximum range is scanned.
  75.  
  76.         2. Scan ahead for matching bytes on the assumption that data
  77.            has been added to the later file. Save the distance to the
  78.            matching bytes. The scan range in the earliest file is
  79.            twice the minimum match length. The later file is scanned
  80.            to the max range.
  81.  
  82.         3. Repeat step 2 with the roles of the files reversed.
  83.  
  84.         4. If steps 2 and 3 did not produce a match, repeat them using
  85.            the maximum scan range in both files.
  86.  
  87.         5. Select the minimum of the above 3 lengths and report all
  88.            bytes within that distance to be unique to the appropriate
  89.            files. In case 1 the data in both files is reported. In case
  90.            2 data in the later file is reported and in case 3 data in
  91.            the earlier file is reported. If no match was found, report
  92.            16 bytes of both files as unique.
  93.  
  94.         6. Load more file data from disk to memory, if appropriate,
  95.            and go back to step 1.
  96.  
  97. As data is reported, it is bypassed by the scan pointers and the scan
  98. resumes at the new pointer positions. The data then need not be at the
  99. same offset in each file to produce a match, since the pointers can move
  100. independently. For difficult files, i.e. files with many insertions,
  101. deletions and/or changes, the maximum range and minimum match length
  102. parameters may be modified by the user but only after the prompt message
  103. appears on the screen. Hence the file names must not be included on the
  104. command line that calls CMP.COM. Both parameters must be specified.
  105. The syntax is:
  106.  
  107.             /max scan range/min match length [,filespec]
  108.  
  109. Any combination of numbers may be used but the max scan range must be
  110. more than twice the min match length and the range connot exceed half the
  111. available memory. i.e. the memory space allocated to one of the files.
  112. Otherwise the "improper number(s)" message appears and the parameters
  113. are not accepted.
  114.  
  115. Examples of commands entered while still under DOS's control.
  116.                 CMP FILE1.TXT   FILE2.TEXT
  117.                 CMP A:FILE1.TXT,B:
  118.                 CMP A:FILE1.TXT
  119.  
  120. Examples of commands entered while under CMP.COM's control.
  121.                 FILE1.TXT FILE2.TEXT
  122.                 A:FILE1.TXT B:
  123.                 A:FILE1.TXT
  124.                 /150/12 a:file1.txt,b:file1.txt
  125.                 /30/6
  126.  
  127.  
  128. Prompting messages:
  129.  
  130.         Enter the files to be compared or new parameters
  131.  
  132. This is the prompt message to type in the file specifications or
  133. new parameters for the scan algorithm. They must be on the same
  134. line separated by tab, space or comma. The parameters, if present,
  135. must preceed the file names. If file specifications have been
  136. entered previously, it is only necessary to press enter to repeat
  137. the comparison.
  138.  
  139.               Compare more files (Y/N) ?
  140.  
  141. This message only appears if CMP.COM was called without trailing
  142. parameters specifying the files. The assumption is made that the
  143. disk containing CMP.COM was removed from the drive.
  144. If another compare operation is desired, enter "Y", otherwise
  145. enter "N" and control is returned to DOS (the command processor).
  146.  
  147.  
  148.  
  149. Informative messages:
  150.  
  151.  
  152.                  Comparing file to itself
  153.  
  154. The file specifications refer to the same file. It is being compared
  155. to itself to verify the integrity of the disk data.
  156.  
  157.                    Files are identical
  158.  
  159. The files contain identical data and are the same length. The date
  160. and time might be different.
  161.  
  162.  
  163.  
  164. Error messages:
  165.  
  166.                    FILESPEC is empty
  167.  
  168. There is no data in the indicated file.
  169.  
  170.                   FILESPEC not found
  171.  
  172. The indicated file could not be found on the specified drive.
  173.  
  174.             Invalid drive or file specification
  175.  
  176. DOS found the drive, file name or file extention to be invalid.
  177.  
  178.                   Improper number(s)
  179.  
  180. The max range was either less than or equal to twice the min match
  181. length, or greater than half the available memory space, or only one
  182. parameter was specified.
  183.  
  184. /ex
  185.  
  186.  
  187. Press ENTER to continue: h, or greater than half the avalable memory space, or only one
  188. parameter was specified.
  189.  
  190. /ex
  191.  
  192.  
  193. Press ENTER to continue: h, or greater than half the ava